﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace GTA.Web.UserControls
{
    public partial class ucMessage : System.Web.UI.UserControl
    {
        public enum MessageType
        {
            Error,
            Alert,
            Info
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            StartControl();
        }
        private void StartControl()
        {
        }

        #region Methods
        public void ShowMessage(String message, MessageType type)
        {
            tbMessage.Visible = true;
            lblMessage.Text = message;
            switch (type)
            {
                case MessageType.Error:
                    imgMessage.ImageUrl = "~/Files/Images/error.png";
                    break;
                case MessageType.Alert:
                    imgMessage.ImageUrl = "~/Files/Images/alert.png";
                    break;
                case MessageType.Info:
                    imgMessage.ImageUrl = "~/Files/Images/info.png";
                    break;
            }
        }
        public void HideMessage()
        {
            tbMessage.Visible = false;
            lblMessage.Text = String.Empty;
        }
        #endregion
    }
}